package org.xxpay.pay.channel.chengzhi;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.Assert;
import org.xxpay.common.unify.AbstractPaymentConfig;

public class ChengzhiConfig extends AbstractPaymentConfig {
    public static final String CHANNEL_NAME = "chengzhi";
    public static final String CHANNEL_NAME_ALIPAY = CHANNEL_NAME + "_ali_qr";

    public static final String REQ_PAY_URL_FIXX = "/pay";
    public static final String REQ_PAY_QUERY_URL_FIXX = "/pay/query";
    ChengzhiConfig(String payParam){
        Assert.notNull(payParam, "init sft config error");
        JSONObject object = JSON.parseObject(payParam);
        setAppId(object.getString("appId"));
        setPrivateKey(object.getString("privatekey"));
        setRequestUrl(object.getString("requestUrl"));
        setPayMode(object.getString("payType"));
    }
}
